1. Field of the Invention
The present invention relates to a printing apparatus and a control method for the same.
2. Description of the Related Art
Hitherto, a thermal printer has been known as a printer configured to print on a recording sheet (thermal paper). The thermal printer includes a printing unit that can be reduced in size and weight, and has a simple configuration without using toner or ink. Therefore, the thermal printer is employed for, for example, cash registers or mobile terminal devices to be widely used to print various labels, receipts, and tickets.
As the thermal printer, there is given one configured to print on rolled paper. In such thermal printer, print data is continuously input to be printed in order of the input. When the input of print data is interrupted in the thermal printer, the print data, which does not reach the end, remains stored in a memory. Under this remained state, when new print data is input to the thermal printer, the new print data is stored sequentially to the interrupted print data. As a result, there is a fear in that the thermal printer may print the interrupted print data and the new print data in an incorporated manner, and may cause data corruption in print (phenomenon in which print data is not correctly displayed). To address this problem, when the input of print data is interrupted, the thermal printer deletes the print data stored in the memory and then prints normally the new print data.
It is necessary to detect a data section such as a beginning of a print job in order to delete the interrupted print data from the memory in the thermal printer. For example, as a technology of this type, there has been hitherto known a method involving detecting a data section by analyzing a command contained in print data.
However, it is sometimes not possible to detect an appropriate data section even when the command of print data is analyzed as in the related art. For example, there is no concept of “page” when printing is performed on rolled paper as in the above-mentioned thermal printer. Therefore, the data section may not be detected by simply analyzing the print data, and thus the interrupted print data may not be deleted.
Further, in some cases, a plurality of hosts are connected to the thermal printer via a LAN line and print data is transmitted from those plurality of hosts. In this case, when print data in the memory is deleted in bulk based on provision of a print interruption request by a particular host, print data that has been transmitted from another host may be deleted as well. When a part of the print data that has been transmitted from another host is deleted, the printing cannot be performed normally as a result, which means that bulk deletion in the memory is problematic.
Further, in a case where the thermal printer is connected to the LAN line, when a host has transmitted print data and then another host also transmits print data during the printing of the print data of the original host, printing for another host is put into a waiting state. In this state, the print data transmitted from another host is temporarily stored in the memory. However, when the printing for the original host is interrupted and transmission of print data of another host is also interrupted, the interrupted print data remains in the memory, resulting in a fear of causing data corruption in print.
In view of the points described above, in this technical field, there are desired a printing apparatus and a control method capable of preventing the data corruption in print even when the print data is transmitted from the plurality of data transmission sources.